package com.dm.hdfxxt.outmanage.controller;

import com.dm.hdfxxt.outmanage.service.OutService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping(value = "goOutBound")
public class OutController {
    private static final Logger logger = LoggerFactory.getLogger(OutController.class);

    @Autowired
    private OutService outService;

    /**
     * @Description  查询所有该店面入库单据
     * @Author zhangxue
     * @Date 11:35 2018/10/30
     * @Param
     * @retrun
     **/
    @RequestMapping(value="/queryAllInBound",method = RequestMethod.POST,produces = "application/json;charset=utf-8")
    @ResponseBody
    public Map<String,Object> queryAllInBound(@RequestBody Map<String,Object> param){
        Map<String,Object> ResultMap = new HashMap<>();
        List<Map<String,Object>> ResultList = outService.queryAllInBound(param);
        ResultMap.put("ResultList",ResultList );
        return ResultMap;
    }

    /**
     * @Description 保存出库信息
     * @Author zhangxue
     * @Date 18:29 2018/9/29
     * @Param
     * @retrun
     **/
    @RequestMapping(value="/saveOutBound",method = RequestMethod.POST,produces = "application/json;charset=utf-8")
    @ResponseBody
    public Map<String,Object> saveOutBound(@RequestBody Map<String,Object> param){
        Map<String,Object> ResultMap = new HashMap<>();
        ResultMap = outService.saveOutBound(param);
        return ResultMap;
    }

    /**
     * @Description  查询所有该店面出库单据
     * @Author zhangxue
     * @Date 11:35 2018/10/30
     * @Param
     * @retrun
     **/
    @RequestMapping(value="/queryAllOutBound",method = RequestMethod.POST,produces = "application/json;charset=utf-8")
    @ResponseBody
    public Map<String,Object> queryAllOutBound(@RequestBody Map<String,Object> param){
        Map<String,Object> ResultMap = outService.queryAllOutBound(param);
        return ResultMap;
    }

    /**
     * @Description 删除出库信息
     * @Author zhangxue
     * @Date 18:29 2018/9/29
     * @Param
     * @retrun
     **/
    @RequestMapping(value="/delOutBound",method = RequestMethod.POST,produces = "application/json;charset=utf-8")
    @ResponseBody
    public Map<String,Object> delOutBound(@RequestBody Map<String,Object> param){
        Map<String,Object> ResultMap = new HashMap<>();
        ResultMap = outService.delOutBound(param);
        return ResultMap;
    }

    /**
     * @Description 编辑出库信息
     * @Author zhangxue
     * @Date 18:29 2018/9/29
     * @Param
     * @retrun
     **/
    @RequestMapping(value="/editDealer",method = RequestMethod.POST,produces = "application/json;charset=utf-8")
    @ResponseBody
    public Map<String,Object> editDealer(@RequestBody Map<String,Object> param){
        Map<String,Object> ResultMap = new HashMap<>();
        ResultMap = outService.editDealer(param);
        return ResultMap;
    }




}
